﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/**
 * 创建时间：2014/12/19 11:24:55
 * 作者：yong.blackcore
 * Email：itblackhole@outlook.com
 * QQ：50404503
 */
namespace ComicIsland.Common.Entities.ComicDatabase
{
    [Table]
    public class DbComic
    {
        /// <summary>
        /// 版本列，可以显著改进表的更新性能
        /// </summary>
        [Column(IsVersion = true)]
        private Binary _version;

        [Column(DbType = "INT NOT NULL IDENTITY", IsDbGenerated = true, IsPrimaryKey = true)]
        public int Id { get; set; }

        [Column]
        public int ComicId { get; set; }
        [Column]
        public string ComicTitle { get; set; }
        [Column]
        public string CoverUrl { get; set; }
        [Column]
        public string DownloadStatus { get; set; }

        public override string ToString()
        {
            StringBuilder content = new StringBuilder();
            content.Append(string.Concat("_version", ":", this._version, ","));
            content.Append(string.Concat("Id", ":", this.Id, ","));            
            //
            content.Append(string.Concat("ComicId", ":", this.ComicId, ","));
            content.Append(string.Concat("ComicTitle", ":", this.ComicTitle, ","));
            content.Append(string.Concat("CoverUrl", ":", this.CoverUrl, ","));
            content.Append(string.Concat("DownloadStatus", ":", this.DownloadStatus, ","));

            return content.ToString();
        }
    }
}
